package com.xiashitech.agent.instrumentation.netty.netty_v4_1.server;


import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.ReplayingDecoder;

import java.util.List;

public class CustomNettyDecode extends ReplayingDecoder<Void> {
    public CustomNettyDecode() {
    }   //1

    protected void decode(ChannelHandlerContext ctx,
                          ByteBuf buf, List<Object> out) throws Exception {

        out.add(buf.readBytes(buf.readInt()));
        System.out.println("###out："+out.toString());
    }
}
